package com.ry.demo.concurrent.demo.base;

/**
 * @Author: lihui
 * @Date: 2021-12-02 09:35
 * @Description:
 */
public class JoinDemo {


    public static class TestA {
        public static void main(String[] args) throws InterruptedException {

            Thread threadA = new Thread(() -> {
                System.out.println("aa");
            });

            Thread threadB = new Thread(() -> {
                System.out.println("bb");
            });

            Thread threadC = new Thread(() -> {
                System.out.println("cc");
            });

            threadA.start();
            threadA.join(); // 此时main线程会等待threadA线程执行完毕后，才会继续执行后续逻辑
            threadB.start();
            threadB.join();
            threadC.start();
        }
    }

}
